﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace _0712502_0712504_DesignPatternGame
{
    /// <summary>
    /// Lớp điều khiển việc thực hiện lắp ghép các bộ phận tank
    /// </summary>
    public class TankConstructor
    {
        public TankBodyFactory tankBodyFactory;
        public TankTurretFactory tankTurretFactory;
        public TankConstructor()
        {
           tankBodyFactory = new TankBodyFactory();           
           tankTurretFactory = new TankTurretFactory();          
        }

        public void InitTankPartFactory()
        {
            tankBodyFactory.InitPrototypes();
            tankTurretFactory.InitPrototypes();
        }

        public void Construct(TankBuilder builder)
        {
            builder.BuildBody(tankBodyFactory);
            builder.BuildTurret(tankTurretFactory);
            builder.BuildEngine();
        }
    }
}
